﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace EnetaMvc.Infrastructure
{
    public class MultiValidationResult
    {
        private readonly ICollection<ValidationResult> _results = new List<ValidationResult>();

        public MultiValidationResult()
        {

        }

        public MultiValidationResult(ICollection<ValidationResult> results)
        {
            _results = results;
        }
        
        public bool IsValid()
        {
            return (_results == null || _results.Count == 0);
        }

        public ICollection<ValidationResult> Results
        {
            get { return _results; }
        }
    }
}
